<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\ShopSubscribe
 *
 * @property int $id
 * @property int $uid
 * @property int|null $shop_id
 * @property mixed $created_at
 * @property mixed $updated_at
 * @property-read \App\Models\Shop $shop
 * @property-read \App\Models\User $user
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopSubscribe newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopSubscribe newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopSubscribe query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopSubscribe whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopSubscribe whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopSubscribe whereShopId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopSubscribe whereUid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShopSubscribe whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class ShopSubscribe extends Model
{
    protected $table = 'shop_subscribe';
    protected $primaryKey = 'id';
    protected $fillable = ['uid', 'shop_id'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo(User::class, 'uid', 'uid');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function shop()
    {
        return $this->hasOne(Shop::class, 'shop_id', 'shop_id');
    }
}
